using namespace System;

namespace SimulatorBase {
	public interface class RobotBase {
	public:
		delegate void SetSensorModeHandler(Int32 port, Boolean active);
		delegate void SetLightBrightnessHandler(Int32 port, Int32 level);
		delegate void SetLightStatusHandler(Int32 port, Boolean on);
		delegate void SendMessageHandler(Byte msg);
		delegate Byte ReceiveMessageHandler(Boolean untilBlock);
		delegate void ClearMessageHandler(void);
		delegate void OrderMotorHandler(Int32 port, String^ methodName, Int32 param);
		delegate void CputCLCDHandler(Int32 mode, Char c, Int32 pos);
		delegate void CputWLCDHandler(UInt32 word);
		delegate void CputSLCDHandler(String^ s);
		delegate void ClearLCDHandler(void);
		delegate void PlayHandler(Byte pitch, Byte length);
		delegate void SetSoundDurationHandler(UInt32 len);
		delegate void SetSoundInternoteHandler(UInt32 len);
		delegate void StopSoundHandler(void);
		delegate void BeepSoundHandler(void);
		delegate void NotifyLoopCountHandler(UInt32 count);

		void SetDelegatorSetSensorMode(SetSensorModeHandler^ handler);
		void SetDelegatorSetLightBrightness(SetLightBrightnessHandler^ handler);
		void SetDelegatorSetLightStatus(SetLightStatusHandler^ handler);
		void SetDelegatorSendMessage(SendMessageHandler^ handler);
		void SetDelegatorReceiveMessage(ReceiveMessageHandler^ handler);
		void SetDelegatorClearMessage(ClearMessageHandler^ handler);
		void SetDelegatorOrderMotor(OrderMotorHandler^ handler);
		void SetDelegatorCputCLCD(CputCLCDHandler^ handler);
		void SetDelegatorCputWLCD(CputWLCDHandler^ handler);
		void SetDelegatorCputSLCD(CputSLCDHandler^ handler);
		void SetDelegatorClearLCD(ClearLCDHandler^ handler);
		void SetDelegatorPlay(PlayHandler^ handler);
		void SetDelegatorSetSoundDuration(SetSoundDurationHandler^ handler);
		void SetDelegatorSetSoundInternote(SetSoundInternoteHandler^ handler);
		void SetDelegatorStopSound(StopSoundHandler^ handler);
		void SetDelegatorBeepSound(BeepSoundHandler^ handler);
		void SetDelegatorNotifyLoopCount(NotifyLoopCountHandler^ handler);

		String^ GetSensorName(Int32 port);
		String^ GetMotorName(Int32 port);

		void SetSensorValue(Int32 port, Int32 value);
		Int32 GetSensorValue(Int32 port);

		void SetBatteryLevel(Int32 level);
		Int32 GetBatteryLevel();

		void SendMessageToRobot(Byte msg);
		void SetKeyStatusToRobot(Boolean onoff, Boolean run, Boolean view, Boolean prog);

		Int32 Initialize();
		Int32 Execute();
		Int32 Terminate();

		String^ GetAppName();

	};
}
